package cn.b.sky.mes.qm.service;

import java.util.List;

import cn.b.sky.mes.cm.model.ProcessInspectPicture;
import cn.b.sky.mes.cm.model.ProcessOperation;
import cn.b.sky.mes.cm.model.WorkCenter;
import cn.b.sky.common.model.TreeInterface;
import cn.b.sky.mes.qm.model.DefectInspectRecord;
import cn.b.sky.mes.qm.model.DefectProcessOperation;
import cn.b.sky.mes.qm.model.DefectTopN;
import cn.b.sky.mes.qm.model.InspectRecord;
import cn.b.sky.mes.qm.model.InspectRecordAttachment;
import cn.b.sky.mes.qm.model.UserDefect;
import cn.b.sky.mes.qm.model.condition.InspectRecordCondition;

public interface InspectRecordService {

  List<InspectRecord> getInspectRecordsByCondition(InspectRecordCondition condition);

  int getInspectRecordCountByCondition(InspectRecordCondition condition);

  InspectRecord getInspectRecordById(Long id);

  List<InspectRecordAttachment> getInspectRecordAttachment(Long id);

  /**
   * 
   * <strong>Title : selectDefectInspectRecords<br></strong>
   * <strong>Description : </strong>查询订单明细所对应的缺陷检查信息<br> 
   * <strong>Create on : 2015年12月30日 上午9:01:21<br></strong>
   * <p>
   * @param operation
   * @return
   * List<DefectInspectRecord>
   * @throws 
   * @author dapeng.li<br>
   * @version <strong>v1.0.0</strong><br>
   * <br>
   * <strong>修改历史:</strong><br>
   * 修改人 | 修改日期 | 修改描述<br>
   * -------------------------------------------<br>
   * <br>
   * <br>
   */
  List<DefectInspectRecord> selectDefectInspectRecords(DefectProcessOperation operation);

  List<DefectTopN> getDefectTopNData(InspectRecordCondition condition);

  /**
   * 
   * <strong>Title : selectQmOperation<br></strong>
   * <strong>Description : </strong>查询质量工序br> 
   * <strong>Create on : 2015-12-21 下午04:02:27<br></strong>
   * <p>
   * @param siteCode
   * @param processCode
   * @param processrev
   * @return
   * List<Operation>
   * @throws 
   * @author zhaoxin01<br>
   * @version <strong>v1.0.0</strong><br>
   * <br>
   * <strong>修改历史:</strong><br>
   * 修改人 | 修改日期 | 修改描述<br>
   * -------------------------------------------<br>
   * <br>
   * <br>
   */
  List<ProcessOperation> selectQmOperation(String siteCode, String processCode, String processrev);

  /**
   * 
   * <strong>Title : getDefectNodeTreeWithColor<br></strong>
   * <strong>Description : </strong>查询带颜色缺陷树（文本采集使用）<br> 
   * <strong>Create on : 2015-12-22 上午11:17:19<br></strong>
   * <p>
   * @param siteCode
   * @return
   * List<TreeInterface>
   * @throws 
   * @author zhaoxin01<br>
   * @version <strong>v1.0.0</strong><br>
   * <br>
   * <strong>修改历史:</strong><br>
   * 修改人 | 修改日期 | 修改描述<br>
   * -------------------------------------------<br>
   * <br>
   * <br>
   */
  public List<TreeInterface> getDefectNodeTreeWithColor(String siteCode);

  /**
   * 
   * <strong>Title : selectUserDefects<br></strong>
   * <strong>Description : </strong>查询缺陷收藏<br> 
   * <strong>Create on : 2015-12-22 下午01:22:19<br></strong>
   * <p>
   * @param siteCode
   * @param userCode
   * @return
   * List<UserDefect>
   * @throws 
   * @author zhaoxin01<br>
   * @version <strong>v1.0.0</strong><br>
   * <br>
   * <strong>修改历史:</strong><br>
   * 修改人 | 修改日期 | 修改描述<br>
   * -------------------------------------------<br>
   * <br>
   * <br>
   */
  public List<UserDefect> selectUserDefects(String siteCode, String userCode, String operationCode, boolean isOnlyPic);

  /**
   * 
   * <strong>Title : insertUserDefect<br></strong>
   * <strong>Description : </strong>新增缺陷收藏<br> 
   * <strong>Create on : 2015-12-22 下午03:00:51<br></strong>
   * <p>
   * @param userDefect
   * void
   * @throws 
   * @author zhaoxin01<br>
   * @version <strong>v1.0.0</strong><br>
   * <br>
   * <strong>修改历史:</strong><br>
   * 修改人 | 修改日期 | 修改描述<br>
   * -------------------------------------------<br>
   * <br>
   * <br>
   */
  public void insertUserDefect(UserDefect userDefect);

  /**
   * 
   * <strong>Title : deleteUserDefect<br></strong>
   * <strong>Description : </strong>删除缺陷收藏<br> 
   * <strong>Create on : 2015-12-22 下午03:01:03<br></strong>
   * <p>
   * @param userDefect
   * void
   * @throws 
   * @author zhaoxin01<br>
   * @version <strong>v1.0.0</strong><br>
   * <br>
   * <strong>修改历史:</strong><br>
   * 修改人 | 修改日期 | 修改描述<br>
   * -------------------------------------------<br>
   * <br>
   * <br>
   */
  public void deleteUserDefect(UserDefect userDefect);

  /**
   * 
   * <strong>Title : insertInspectRecords<br></strong>
   * <strong>Description : </strong>新增缺陷检验记录<br> 
   * <strong>Create on : 2015-12-23 下午05:49:57<br></strong>
   * <p>
   * @param inspectRecordList
   * void
   * @throws 
   * @author zhaoxin01<br>
   * @version <strong>v1.0.0</strong><br>
   * <br>
   * <strong>修改历史:</strong><br>
   * 修改人 | 修改日期 | 修改描述<br>
   * -------------------------------------------<br>
   * <br>
   * <br>
   */
  public void insertInspectRecords(List<InspectRecord> inspectRecordList);

  /**
   * 
   * <strong>Title : getProcessInspectPictureByProcessOperation<br></strong>
   * <strong>Description : </strong>根据工艺工序查询质量附件（客户端使用）<br> 
   * <strong>Create on : 2015-12-24 下午03:32:34<br></strong>
   * <p>
   * @param id
   * @return
   * List<ProcessInspectPicture>
   * @throws 
   * @author zhaoxin01<br>
   * @version <strong>v1.0.0</strong><br>
   * <br>
   * <strong>修改历史:</strong><br>
   * 修改人 | 修改日期 | 修改描述<br>
   * -------------------------------------------<br>
   * <br>
   * <br>
   */
  public List<ProcessInspectPicture> getProcessInspectPictureByProcessOperation(int id);

  /**
   * 
   * <strong>Title : selectAllPicDefects<br></strong>
   * <strong>Description : </strong>查询所有图形采集缺陷<br> 
   * <strong>Create on : 2015-12-25 下午01:53:38<br></strong>
   * <p>
   * @param siteCode
   * @param operationCode
   * @return
   * List<UserDefect>
   * @throws 
   * @author zhaoxin01<br>
   * @version <strong>v1.0.0</strong><br>
   * <br>
   * <strong>修改历史:</strong><br>
   * 修改人 | 修改日期 | 修改描述<br>
   * -------------------------------------------<br>
   * <br>
   * <br>
   */
  List<UserDefect> selectAllPicDefects(String siteCode, String operationCode);

  /**
   * 
   * <strong>Title : getInspectRecordWorkCenters<br></strong>
   * <strong>Description : </strong>订单档案查询此订单下过程检验涉及到的工作中心<br> 
   * <strong>Create on : 2016-1-13 下午3:03:18<br></strong>
   * <p>
   * @param condition
   * @return
   * List<WorkCenter>
   * @throws 
   * @author lidapeng<br>
   * @version <strong>v1.0.0</strong><br>
   * <br>
   * <strong>修改历史:</strong><br>
   * 修改人 | 修改日期 | 修改描述<br>
   * -------------------------------------------<br>
   * <br>
   * <br>
   */
  List<WorkCenter> getInspectRecordWorkCenters(InspectRecordCondition condition);
}
